package erfgame.core;

import java.util.ArrayList;
import java.util.Queue;

public class UniquePollingExecutor extends PollingExecutor {

	public UniquePollingExecutor( long delay ) {
		super( delay );
	}

	@Override
	protected void addWaitingCommands(Queue<Runnable> commands,
			ArrayList<Runnable> waitingCommands) {
		for( int i=0; i<waitingCommands.size(); i++ ) {
			Runnable command = waitingCommands.get( i );
			if( !commands.contains(command) ) {
				commands.add( command );
			}
		}
	}
}
